<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Agp\CoreBundle\Manager;

use Agp\CoreBundle\Manager\BaseManager;

/**
 * Description of PostManager
 *
 * @author bondcs
 */
class PostManager extends BaseManager{
    
    public function persist($entity) {
        
        if ($entity->getEnvioNotificacao() == true){
            $emailApi = $this->container->get('agp.email');
            $emailApi->enviarPostagem($entity);
            
            $smsApi = $this->container->get('agp.sms');
            $smsApi->enviarPostagem($entity);
        }
        
        parent::persist($entity);
    }
  
}

?>
